<!--
 * @Author: your name
 * @Date: 2019-10-24 15:52:39
 * @LastEditTime: 2019-10-25 14:48:31
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Pass approval system\src\components\userApplicationList\index.vue
 -->
<template>
  <div>
    <!-- v-loading="loading"
        element-loading-text="拼命加载中"
    element-loading-spinner="el-icon-loading"
    element-loading-background="rgba(0, 0, 0, 0.8)" -->
    <el-table
      :data="applyList"
      :header-cell-style="thStyle">
      <el-table-column
        prop="name"
        label="姓名"
        width="110">
      </el-table-column>
      <el-table-column
        prop="idCard"
        label="身份证号码"
        width="210">
      </el-table-column>
      <!-- :filters="[{ text: '个人用户', value: '个人用户' }, { text: '单位用户', value: '单位用户' }]"
        :filter-method="filterType" -->
      <el-table-column
        label="申请类型"
        width="135">
         <template slot-scope="scope">
            <span v-if="scope.row.userType == 0">个人用户</span>
            <span v-else>企业用户</span>
          </template>
      </el-table-column>
      <el-table-column
        prop="companyName"
        label="单位名称"
        show-overflow-tooltip>
      </el-table-column>
      <el-table-column
        label="申请日期"
        width="165">
        <template slot-scope="scope">
            <span>{{scope.row.applyCreatetime?$dayjs(scope.row.applyCreatetime).format('YYYY-MM-DD'):""}}</span>
          </template>
      </el-table-column>
      <el-table-column
        label="审核日期"
        width="165" v-if="examineDate">
        <template slot-scope="scope">
            <span>{{scope.row.dealTime?$dayjs(scope.row.dealTime).format('YYYY-MM-DD'):''}}</span>
        </template>
      </el-table-column>
      <!--  :filters="[{ text: '已禁用', value: '已禁用' }, { text: '已拒绝', value: '已拒绝' },{ text: '申请中', value: '申请中' }, { text: '已核准', value: '已核准' }]"
      :filter-method="filterStatus" -->
      <el-table-column
      label="申请状态"
      width="165">
      <template slot-scope="scope">
            <span v-if="scope.row.status == 0">未审核</span>
            <span v-if="scope.row.status == 1">已批准</span>
            <span v-if="scope.row.status == 2">已拒绝</span>
      </template>
      </el-table-column>
      <el-table-column label="操作"  width="160">
        <template slot-scope="scope">
            <el-button type="primary" @click="handleEdit(scope.$index,scope.row)" size="mini">查看
            </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: ['examineDate', 'applyList'],
  data () {
    return {
      id: 0,
      status: '',
      loading: true,
      thStyle: {
        fontSize: '16px'
      }
    }
  },
  methods: {
    handleEdit (index, row) {
      this.id = row.id
      this.$router.push({ name: 'userApplicationInfo', params: { 'id': this.id } })
    },
    filterType () {

    },
    filterStatus () {

    }
  }
}
</script>

<style scoped>
   .el-table{
      margin-top:-10px;
      font-size: 15px;
  }
</style>
